import * as React from "react"
const { Fragment, useEffect, useMemo, useState, useRef, useCallback, createRef, memo } = React;
const bigTask = () => {
    return
}

const MemoTest = () => {
    const [count, setCount] = useState(0);
    const fn = useCallback(() => {
        console.log("fn from parent component")
    }, [])
    const fn2 = useMemo(() => {
        return () => {
            console.log("fn from parent component")
        }
    })
    return (
        <div>
            <h2>useMemo, useCallback test {count}</h2>
            <button onClick={() => setCount(count + 1)}>Click</button>
            <ChildComponent fnFromSuper={fn2} />
        </div>
    )
}

const ChildComponent = memo(({fnFromSuper}) => {
    console.log("Child init");
    return (
        <div>This is child component</div>
    )
})

export default MemoTest;